UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ehotmKoSFwRXBZ+qzjyYeBAD+/lZul3w7X4PSVIF48s=' 
WHERE 
  key_id = '1809fcd9de82edf8ebcf34bd02b73badb98b4291957d6451c5854c8f3b5a53ba' 
  AND (
    token = 'ehotmKoSFwRXBZ+qzjyYeBAD+/lZul3w7X4PSVIF48s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049