UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ku84tY/qx90r1lEGk3iy5GCElbc0jtLg4RzXJvTGuAk=' 
WHERE 
  key_id = '32bbbe6c1710e05086de5933ef728f2d4a6067a81f41d7d7dcd63e3fb9cb548b' 
  AND (
    token = 'ku84tY/qx90r1lEGk3iy5GCElbc0jtLg4RzXJvTGuAk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00052