UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'KUZ0xA/qDOjTap4LVtClZVVDVwqkRs3D1Ybztcgg1uk=' 
WHERE 
  key_id = '01909068ec6cfa9d266a72f05a1dadb90298876758dbd4d349461f51e96661ff' 
  AND (
    token = 'KUZ0xA/qDOjTap4LVtClZVVDVwqkRs3D1Ybztcgg1uk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017