UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zUDU9MvZa6oX2ksYMGIp90sO62P2oNlZufPKM17R1ZA=' 
WHERE 
  key_id = 'a7a28a15fff3f2a33fa04c01c3d971fbd487a4e411e2276e7b9e5f6937d4f481' 
  AND (
    token = 'zUDU9MvZa6oX2ksYMGIp90sO62P2oNlZufPKM17R1ZA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049