UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'sbR6H6rsHx984afO0XgCjXbejAqNIrYIM7FuLBhE7jc=' 
WHERE 
  key_id = 'd5d45a2b75dcb265fbac049d94025e4366919c3a4d5c5096ca0ee8352d57991b' 
  AND (
    token = 'sbR6H6rsHx984afO0XgCjXbejAqNIrYIM7FuLBhE7jc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047