UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'iLcb/F0+1i4c6pJItp2h/g0qIskHplLSw1bWkQPN/sc=' 
WHERE 
  key_id = '55da8c39cc68576a397d7ea9e82097abef93b1852710a360db65a83fbcd5aea6' 
  AND (
    token = 'iLcb/F0+1i4c6pJItp2h/g0qIskHplLSw1bWkQPN/sc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033