UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qVFX6oZN1PHR0mYqHeDyQKF5R0AOtdGbZcOqI2jKKEU=' 
WHERE 
  key_id = '33346a81263cca8a49163e75a917db7381546793c35a6806465cc441502c0661' 
  AND (
    token = 'qVFX6oZN1PHR0mYqHeDyQKF5R0AOtdGbZcOqI2jKKEU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038