UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Mm6vun3v5tvzOSw8uj297zWp4jjKWqnb8c+ZpiPC/1I=' 
WHERE 
  key_id = '28c0fe9fbc12315298f3240056c7c092b9ecccd0c336740fbc4b3fab9c536568' 
  AND (
    token = 'Mm6vun3v5tvzOSw8uj297zWp4jjKWqnb8c+ZpiPC/1I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00058