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

Query time 0.00031