UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'die7JNDGvR1AEmVMwfjELhtw8hY/V+SZkBMiz2YKdVM=' 
WHERE 
  key_id = '102b1cee217e2b68ffe33ce451d9a1a1d6d4b91630d4fdf8942ae009009eb67c' 
  AND (
    token = 'die7JNDGvR1AEmVMwfjELhtw8hY/V+SZkBMiz2YKdVM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031