UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '13aZ4SD0di7b6iGHrXZ/TriV3eiXw6xyBTQy+nVlGHk=' 
WHERE 
  key_id = 'db7853a53fdbfde9f81b599674e6da2f0acb27857217f0a70ae4f8b50c0acdfc' 
  AND (
    token = '13aZ4SD0di7b6iGHrXZ/TriV3eiXw6xyBTQy+nVlGHk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041