UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/h8tilk10Kv/vtw2/XRzeZghAl8TV6ML+ucctaj4pUA=' 
WHERE 
  key_id = '862fad3f817495c1ba727cfe8bb0f39d49cc3cc699344519712a1b7944860bb4' 
  AND (
    token = '/h8tilk10Kv/vtw2/XRzeZghAl8TV6ML+ucctaj4pUA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024