UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Ff6bZjO/fth/XFHmt7kyo/C9Tb8u4BzXcjqZJTkIxvQ=' 
WHERE 
  key_id = '8baf20396b010ab8916d4076bdad47f7c14c11acda5d4525da00467ab1f003fa' 
  AND (
    token = 'Ff6bZjO/fth/XFHmt7kyo/C9Tb8u4BzXcjqZJTkIxvQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033