UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Fiwhgdjs8aLJfxH7rNquxytDhQ2Kyiq/ePXlemTY9Rw=' 
WHERE 
  key_id = '528147a7c5ce79b87d150f93868fd11ed70c5350e3e1b2ea662d86e5931cbb3c' 
  AND (
    token = 'Fiwhgdjs8aLJfxH7rNquxytDhQ2Kyiq/ePXlemTY9Rw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029