UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PPkNn1UR63/gvalrGacRGkqH4xsLI5o7eHH97WxNMDA=' 
WHERE 
  key_id = '071dfafe3d054238b167e6e5420c54e47a3e6e49f220346e1134e684db2224e2' 
  AND (
    token = 'PPkNn1UR63/gvalrGacRGkqH4xsLI5o7eHH97WxNMDA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025