UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'srmRhP9UXfwCYNQ29pJLELRPgRIHp0ScALaxDClxRyM=' 
WHERE 
  key_id = '19fb76c376fa82bd827b2ae7ba945b9ca4bdc36f676b3192c3df63d8f3af2900' 
  AND (
    token = 'srmRhP9UXfwCYNQ29pJLELRPgRIHp0ScALaxDClxRyM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00013