UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'dge2fX3MPvuL9R/UotyUd/uASgSDUG++lkXhXwAAc04=' 
WHERE 
  key_id = '0b27e53a1499add13f483a10b403d6d7f8db34d2bda0aad9cddebabd73d80c33' 
  AND (
    token = 'dge2fX3MPvuL9R/UotyUd/uASgSDUG++lkXhXwAAc04=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019