UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '//2eUygRFGpRbvKXI/xN1Bj2IliHhYyREpUJ5vPjAXs=' 
WHERE 
  key_id = '127528f0ffad18d227c247d1893357207f3494bc6665567ec1076e1229d02f34' 
  AND (
    token = '//2eUygRFGpRbvKXI/xN1Bj2IliHhYyREpUJ5vPjAXs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043