UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EikiX5hS/Y0zF74iCwcG7owb598bux1bnrXS0dD2Vnk=' 
WHERE 
  key_id = 'b6fa52d3c6c2784a094f06126462ca8e0a19419b7e71b15d698bfc3e630e2982' 
  AND (
    token = 'EikiX5hS/Y0zF74iCwcG7owb598bux1bnrXS0dD2Vnk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045