UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'oid5gORO84OUo23gMoYQeavudGJtN4xDWP2ASG6ioB8=' 
WHERE 
  key_id = '75a0a47be343b2b4aee5f0c6859768ad1fc410b5105e50dd62093140ea0b1858' 
  AND (
    token = 'oid5gORO84OUo23gMoYQeavudGJtN4xDWP2ASG6ioB8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027