UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PmIfqB5fS6kTfmgYz++pnV31xjhUHDgMM7jD93X653I=' 
WHERE 
  key_id = '28646de6d202cd4d2f865b40c24d2bb394b499c031ebf594ea6cafced8bdf056' 
  AND (
    token = 'PmIfqB5fS6kTfmgYz++pnV31xjhUHDgMM7jD93X653I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044