UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'YexqJNY8lOGYjHkRr++BQlpSEridfXB5Xpzltig7RpA=' 
WHERE 
  key_id = '07748524ae0d6213c20b890fa18e0807ec4fc579f6c4c82b3ad300d249c3b0b2' 
  AND (
    token = 'YexqJNY8lOGYjHkRr++BQlpSEridfXB5Xpzltig7RpA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024