UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'eudC05IwvmlgNbp43n5kIiyntIAAy1/StDOXC9DoCZY=' 
WHERE 
  key_id = '948ccb8259519c67994de078e9883673a4060366123e5f100d3b9997b7c1590b' 
  AND (
    token = 'eudC05IwvmlgNbp43n5kIiyntIAAy1/StDOXC9DoCZY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021