UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rPYgdXW1RgkXMBOWQ1ZgUZH7/ZzSqrRqT1rawn1kxLk=' 
WHERE 
  key_id = '51527c366693cb024c19174e75bb2de4dc29120ecd1e9b79d1c41499b9cc0ee8' 
  AND (
    token = 'rPYgdXW1RgkXMBOWQ1ZgUZH7/ZzSqrRqT1rawn1kxLk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032