UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gII82Vb1GmBgowo9PA1AP5naz4rDbusOeZ+bhdwQSeg=' 
WHERE 
  key_id = 'c701806371760b89fce2b3b38c2dbf0ac18e692fe9b0a74d3192a70239ee8f52' 
  AND (
    token = 'gII82Vb1GmBgowo9PA1AP5naz4rDbusOeZ+bhdwQSeg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020