UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ljyWVn7j98s1QqsWzkMQ8IPeMGXVJPEZMHPa6kLZyBo=' 
WHERE 
  key_id = '26e36bcaa8f2620c1d93e28c5545c419dcf6be56d7e625b858151736c4caf7a0' 
  AND (
    token = 'ljyWVn7j98s1QqsWzkMQ8IPeMGXVJPEZMHPa6kLZyBo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019