UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/3luapgzvugkvV6q627nftCPP0v/Za2mr3fiCrycW1I=' 
WHERE 
  key_id = '4b6ba868816960df80292191056549bf10d8c6ee0f8997ca5580c2d7a8def887' 
  AND (
    token = '/3luapgzvugkvV6q627nftCPP0v/Za2mr3fiCrycW1I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034