UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VQ94Dv9zEtVHgtdjNo5pAYAj4lKY7U3QVZJR6y3WSgc=' 
WHERE 
  key_id = '9609a4f95bceaf2623e888a135a65203c43425fbbaeb4121547384c838a1759e' 
  AND (
    token = 'VQ94Dv9zEtVHgtdjNo5pAYAj4lKY7U3QVZJR6y3WSgc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027